#define  _CRT_SECURE_NO_WARNINGS 1

#include<bits/stdc++.h>
//#define debug(a) cout<<#a<<"="<<a<<endl
//#define lyh(i,a,b) for(int i=a;i<b;i++)
//#define hyl(i,a,b) for(int i=a;i>=b;i--)
//#define push_back pb;
//#define all(x) (x).begin(),(x).end()
//#define rall(x) (x).rbegin(),(x).rend()
//#define fi first
//#define se second
//#define pii pair<int, int>;
//#define vi vector<int>;
//#define yesno(condition) if(condition)cout<<"YES\n";else cout<<"NO\n";
typedef long long int ll;
using namespace std;
//----------------------------------------------------------------------------//
void solve()
{
	
	/*set<int> s;
	for (int i = 0; i < 10; i++)
	{
		s.insert(i);
	}
	int tmp = *(s.begin());
	cout << tmp;*/
	/*int a;
	cin >> a;
	yesno(a > 10);*/



	/*string s = to_string('a');
	cout << s;*/

	char a = 'a' + 1;
	cout << a << endl;
}

string greatestLetter(string s) {
	int arr[26][2] = { 0 };
	for (auto& x : s)
	{
		if (x >= 'a' && x <= 'z')
			arr[x - 'a'][0]++;
		if (x >= 'A' && x <= 'Z')
			arr[x - 'A'][1]++;
	}
	for (int i = 25; i >= 0; i--) {
		if (arr[i][0] != 0 && arr[i][1] != 0) {
			char tmp = i + 'A';
			string ans;
			ans.push_back(tmp);
			return ans;
		}

	}
	return "";


}

int main()
{
	/*int t;
	cin >> t;
	while (t--)
	{
		solve();
	}*/

	string s1 = "lEeTcOdE";
	greatestLetter(s1);

	return 0;
}